<template>
  <div>
    
        <div class="card" :style={backgroundColor:backgroundcart} >
         <div class="sj-info">
          <img class="logo " src="@/assets/img/timg.jpg" > 
          <p class="sj-title " >商家名称</p>
         </div>
         <div  class="cart-info">
           <p class="zk-title">88折扣劵</p>
           <p class="zk-desc">这一张88折扣劵</p>
           <p class="zk-desc">有效日期：2018-06-19~2018-06-30</p>
         </div>
          
          
        </div>
        <div class="cart-def" :style={backgroundColor:background} >
          <div v-show="iscart">
            <barcode value="2569489623671563" :options="{height:50,displayValue:false,marginBottom:1,background:background}" ></barcode>
            <p class="cart-num">2569-4896-2367-1563</p>
            <p class="cart-desc">请到店出示卡劵</p>

          </div>
          <div v-show="!iscart">
            <div class="cart-btn">
                <x-button type="primary" :style={backgroundColor:backgroundcart}>点击领取</x-button>
            </div>
               
          </div>
        </div>
        
    <divider>详细信息</divider>
     <div class="cart-defxx" >
        <ul>
          <li>消费满20元可使用</li>
          <li>每人每次只能领卡劵一次</li>
          <li>每次消费可使用一张卡劵</li>
        </ul>
      </div>
<divider>商家信息</divider>
    <div class="sj-defxx" >
        <ul>
            <li>商家电话：</li>
            <li>商家地址：</li>

        </ul>
    </div>
  </div>
</template>
<script>
import { Divider,XButton } from 'vux'

export default {
   components: {
    Divider,XButton
  },data () {
    return {
      background:'#fff',
      backgroundcart:'#ffdd1d',
      iscart:true
    }
  }
}
</script>
<style  lang="less">


.card {
    /* 相对定位，方便让before和after伪元素绝对定位偏移 */
  position: relative;
  width: 100%;
  height: 186px;
 background-color: #ffdd1d;
  .sj-info{
    height: 60px;
    .logo {
      float: left;
      margin-left: 10px;
      margin-top: 10px;
      width: 50px;
      height: 50px;
      -moz-border-radius: 50px;
      -webkit-border-radius: 50px;
      border-radius: 50px;
      display:inline;
      
    }
    .sj-title{
      
        margin-left: 10px;
        line-height: 60px;
        font-size: 16px;
        color: #fff;
        display:inline;
    }
  }
  .cart-info{
    .zk-title{
      width: 100%;
      color: #fff;
      font-size: 28px;
      text-align: center;
    }
    .zk-desc{
       width: 100%;
       padding-top: 10px;
      color: #fff;
      font-size: 16px;
      text-align: center;
      font-weight: 500;
    }
  }
  
}

.card:before, .card:after {
    content: ' ';
    height: 100%;
    /* 绝对定位进行偏移 */
    position: absolute;
    top: 0;
}

.card:before {
    /* 圆点型的border */
    border-right: 14px dotted white;
    /* 偏移一个半径，让圆点的一半覆盖div */
    left: -7px;
}


.card:after {
    /* 圆点型的border */
    border-left: 14px dotted white;
    /* 偏移一个半径，让圆点的一半覆盖div */
    right: -7px;
}




.cart-def{
  text-align: center;
  width: 100%;
  height: 150px;
 
  .cart-num{
    font-size: 22px;
    text-align: center;
  }
  .cart-desc{
    width: 100%;
    padding-top: 10px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
  }
  .cart-btn{
    padding: 40px;
  }

}
.cart-defxx{
  padding-left: 30px;
  font-size: 16px;
  ul{
  text-decoration:#000;
  list-style-type:disc;
  li{
    margin: 4px;
  }
  }
  
  
}
.sj-defxx{
  padding-left: 10px;
  font-size: 16px;
  li{
    margin: 4px;
  }
}

</style>
